﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using DuAnNH.Fd_class;

namespace DuAnNH
{
    public partial class Frm_Main : Office2007RibbonForm
    {
        public Frm_Main()
        {
            InitializeComponent();
        }

        private void btt_MA_Click(object sender, EventArgs e)
        {
            Frm_MA frm_ma = new Frm_MA();
            frm_ma.ShowDialog();
        }

        private void btt_Ma_up_Click(object sender, EventArgs e)
        {
            Frm_MA_Update frm_ma_up = new Frm_MA_Update();
            frm_ma_up.ShowDialog();
        }

        private void btt_GB_Click(object sender, EventArgs e)
        {
            Frm_GhepBan frm_GB = new Frm_GhepBan();
            frm_GB.ShowDialog();
        }

        private void btt_TT_Click(object sender, EventArgs e)
        {
            Frm_TT frm_tt = new Frm_TT();
            frm_tt.ShowDialog();
        }

        private void btt_NV_Click(object sender, EventArgs e)
        {
            Frm_QL_NV frm_ql_nv = new Frm_QL_NV();
            frm_ql_nv.ShowDialog();
        }

        private void btt_TD_Click(object sender, EventArgs e)
        {
            Frm_QL_TD frm_ql_td = new Frm_QL_TD();
            frm_ql_td.ShowDialog();
        }

        private void btt_HD_Click(object sender, EventArgs e)
        {
            Frm_QL_HD frm_ql_hd = new Frm_QL_HD();
            frm_ql_hd.ShowDialog();
        }

        private void btt_TK_Click(object sender, EventArgs e)
        {
            Frm_TKe frm_tk = new Frm_TKe();
            frm_tk.ShowDialog();
        }

        private void btt_ttpm_Click(object sender, EventArgs e)
        {
            Frm_TTPM frm_ttpm = new Frm_TTPM();
            frm_ttpm.ShowDialog();
        }

        private void Frm_Main_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = (MessageBox.Show("Bạn thật sự muốn đóng chương trình?", "Thông Báo!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No);
        }

        private void Frm_Main_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            labelItem2.Text = DateTime.Now.ToString();
            // chạy chữ
            int i, k, l, m, n, q;
            i = labelX44.Location.X;
            k = lbTenDN.Location.X;
            l = lb.Location.X;
            m = lbHoTen.Location.X;
            n = labelX72.Location.X;
            q = lbQuyen.Location.X;

            if (i >= 950)
                i = 100;
            else
                i = labelX44.Location.X + 5;
            if (k >= 950)
                k = 10;
            else
                k = lbTenDN.Location.X + 5;
            if (l >= 950)
                l = 100;
            else
                l = lb.Location.X + 5;
            if (m >= 950)
                m = 100;
            else
                m = lbHoTen.Location.X + 5;
            if (n >= 950)
                n = 100;
            else
                n = labelX72.Location.X + 5;
            if (q >= 950)
                q = 100;
            else
                q = lbQuyen.Location.X + 5;
            labelX44.Location = new Point(i, 5);
            lbTenDN.Location = new Point(k, 5);
            lb.Location = new Point(l, 5);
            lbHoTen.Location = new Point(m, 5);
            labelX72.Location = new Point(n, 5);
            lbQuyen.Location = new Point(q, 5);
        }
    }
}
